package o;

import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.os.Build.VERSION;
import android.view.ViewConfiguration;
import androidx.annotation.RestrictTo;
import androidx.annotation.RestrictTo.d;
import com.huawei.hms.framework.network.restclient.hwhttp.route.IPRoute;
import o.ah.c;
import o.ah.e;
import o.ah.g;

@RestrictTo({d.LIBRARY_GROUP})
public class au {
    private Context ॱ;

    public static au ˏ(Context context) {
        return new au(context);
    }

    private au(Context context) {
        this.ॱ = context;
    }

    public int ˎ() {
        Configuration configuration = this.ॱ.getResources().getConfiguration();
        int i = configuration.screenWidthDp;
        int i2 = configuration.screenHeightDp;
        if (configuration.smallestScreenWidthDp > 600 || i > 600 || ((i > 960 && i2 > 720) || (i > 720 && i2 > 960))) {
            return 5;
        }
        if (i >= IPRoute.INTERVAL || ((i > 640 && i2 > 480) || (i > 480 && i2 > 640))) {
            return 4;
        }
        if (i >= 360) {
            return 3;
        }
        return 2;
    }

    public boolean ˏ() {
        if (VERSION.SDK_INT < 19 && ViewConfiguration.get(this.ॱ).hasPermanentMenuKey()) {
            return false;
        }
        return true;
    }

    public int ˊ() {
        return this.ॱ.getResources().getDisplayMetrics().widthPixels / 2;
    }

    public boolean ˋ() {
        return this.ॱ.getResources().getBoolean(ah$b.ˎ);
    }

    public int ॱ() {
        TypedArray obtainStyledAttributes = this.ॱ.obtainStyledAttributes(null, g.ˏ, c.ॱ, 0);
        int layoutDimension = obtainStyledAttributes.getLayoutDimension(g.ˋ, 0);
        Resources resources = this.ॱ.getResources();
        if (!ˋ()) {
            layoutDimension = Math.min(layoutDimension, resources.getDimensionPixelSize(e.ˊ));
        }
        obtainStyledAttributes.recycle();
        return layoutDimension;
    }

    public boolean ᐝ() {
        return this.ॱ.getApplicationInfo().targetSdkVersion < 14;
    }

    public int ʼ() {
        return this.ॱ.getResources().getDimensionPixelSize(e.ˎ);
    }
}
